﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2022 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Application.HtAdminServices;

public interface IUserService
{
    /// <summary>
    /// 新增或更新一条
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task InsertOrUpdate(HtUserInput input);

    /// <summary>
    /// 删除一条
    /// </summary>
    /// <param name="id"></param>
    Task Delete(int id);

    /// <summary>
    /// 批量删除
    /// </summary>
    /// <param name="ids"></param>
    Task BatchDelete(string ids);

    /// <summary>
    /// 查询一条
    /// </summary>
    /// <param name="id"></param>
    Task<HtUserOut> Get(int id);

    /// <summary>
    /// 分页查询
    /// </summary>
    /// <param name="searchQuery"></param>
    /// <returns></returns>
    Task<LayuiPagedList<HtUserOut>> GetAllByPageToLayui(HtUserQuery searchQuery);

    /// <summary>
    /// 设置状态
    /// </summary>
    /// <param name="id"></param>
    /// <param name="state"></param>
    /// <param name="field">字段名</param>
    /// <returns></returns>
    Task SetState(int id, bool state, string field);
}